// ++++++++++++++++++++++++++++++++++++++++
// 《零基础Go语言算法实战》源码
// ++++++++++++++++++++++++++++++++++++++++
// Author:廖显东（ShirDon）
// Blog:https://www.shirdon.com/
// Gitee:https://gitee.com/shirdonl/goAlgorithms.git
// Buy link :https://item.jd.com/14101229.html
// ++++++++++++++++++++++++++++++++++++++++

package main

import "fmt"

type Animal interface {
	Speak() string
}

type Tiger struct{}

func (d Tiger) Speak() string {
	return "Tiger Speak"
}

type Lion struct{}

func (c Lion) Speak() string {
	return "Lion Speak"
}

func main() {
	animals := []Animal{Tiger{}, Lion{}}
	for _, animal := range animals {
		fmt.Println(animal.Speak())
	}
}

//$ go run polymorphism.go
//Tiger Speak
//Lion Speak
